/*
 * @Date: 2022-05-22 20:44:25
 * @Description: 
 */
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/display.css' // 引入基于断点的隐藏类
import 'element-plus/dist/index.css'
import 'normalize.css' // css初始化
import './assets/style/common.scss' // 公共css
import './theme/modules/chinese/index.scss'
import App from './App.vue'
import './utils/rem'
import store from './store'
import router from './router'
import { getAuthRoutes } from './router/permission'
import i18n from './locale'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import txIm from './utils/txIm'
if (localStorage.getItem('token')) {
  txIm.loginIm(localStorage.getItem('info'))
}
const link = document.createElement('link');
link.rel = 'icon';
link.type = 'image/x-icon';
link.href =import.meta.env.MODE=='cardlumi'?'tubiao.svg':'tubiao.svg';
document.head.appendChild(link);


/** 权限路由处理主方法 */
getAuthRoutes().then(() => {
  const app = createApp(App)
  app.use(ElementPlus, { size: store.state.app.elementSize })
  app.use(store)
  app.use(router)
  app.use(i18n)
  // app.config.performance = true
  app.mount('#app')
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
})

